From 899b4c43f687dd577d90b0a875676868b8eaa835 Mon Sep 17 00:00:00 2001 From: Tim Deegan Date: Wed, 11 Apr 2012 13:10:33 +0100 Subject: [PATCH] x86: don't use .subsection when compiling with clang LLVM's assembler doesn't support the .subsection directive, so put the out-of-line failure path in .fixup instead. Signed-off-by: Tim Deegan Acked-by: Jan Beulich Acked-by: Keir Fraser Committed-by: Tim Deegan --- xen/include/asm-x86/spinlock.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/xen/include/asm-x86/spinlock.h b/xen/include/asm-x86/spinlock.h index a31f8b725b..6bc044c7ac 100644 --- a/xen/include/asm-x86/spinlock.h +++ b/xen/include/asm-x86/spinlock.h @@ -45,11 +45,19 @@ static always_inline int _raw_read_trylock(raw_rwlock_t *rw) asm volatile ( " lock; decl %0 \n" " jns 2f \n" +#ifdef __clang__ /* clang's builtin assember can't do .subsection */ + "1: .pushsection .fixup,\"ax\"\n" +#else "1: .subsection 1 \n" +#endif "2: lock; incl %0 \n" " decl %1 \n" " jmp 1b \n" +#ifdef __clang__ + " .popsection \n" +#else " .subsection 0 \n" +#endif : "=m" (rw->lock), "=r" (acquired) : "1" (1) : "memory" ); return acquired; -- 2.30.2